:root {
  font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: #1f2933;
  background-color: #f4f7fb;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #d7ebff 0%, #f8f9fc 100%);
}

.container {
  width: min(720px, 92vw);
  background-color: #fff;
  border-radius: 18px;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.1);
  padding: 2.5rem 2.75rem;
  box-sizing: border-box;
}

.app-header h1 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
}

.subtitle {
  margin-top: 0.35rem;
  color: #52606d;
}

.flash-list {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0;
  display: grid;
  gap: 0.75rem;
}

.flash-item {
  padding: 0.9rem 1.1rem;
  border-radius: 12px;
  font-size: 0.95rem;
  background-color: #eff6ff;
  color: #1d4ed8;
}

.flash-item.error {
  background-color: #fee2e2;
  color: #b91c1c;
}

.flash-item.success {
  background-color: #dcfce7;
  color: #15803d;
}

.new-todo-section {
  margin-top: 1.5rem;
}

.todo-label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.input-group {
  display: flex;
  gap: 0.75rem;
}

.input-group input {
  flex: 1;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  border: 1px solid #d7e1f0;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-group input:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.15);
}

.input-group button {
  padding: 0.9rem 1.5rem;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb 0%, #4f46e5 100%);
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.input-group button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(79, 70, 229, 0.45);
}

.todo-list {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0 0;
  display: grid;
  gap: 1rem;
}

.todo-item {
  border: 1px solid #e3e8f4;
  border-radius: 16px;
  padding: 1.1rem 1.2rem;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: #fff;
}

.todo-item.completed {
  border-color: #cbd5f5;
  background-color: #f8faff;
}

.todo-display {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.toggle-form input[type="checkbox"] {
  width: 22px;
  height: 22px;
  cursor: pointer;
  accent-color: #2563eb;
}

.todo-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.todo-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #1f2937;
}

.todo-item.completed .todo-title {
  text-decoration: line-through;
  color: #94a3b8;
}

.todo-time {
  font-size: 0.85rem;
  color: #64748b;
}

.todo-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.todo-actions button {
  border: none;
  border-radius: 10px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  cursor: pointer;
  background-color: #f1f5f9;
  color: #1f2937;
  transition: background-color 0.2s ease, transform 0.15s ease;
}

.todo-actions button:hover {
  background-color: #e2e8f0;
  transform: translateY(-1px);
}

.todo-actions .danger {
  background-color: #fee2e2;
  color: #b91c1c;
}

.todo-actions .danger:hover {
  background-color: #fecaca;
}

.edit-form {
  margin-top: 1rem;
  display: none;
  flex-direction: column;
  gap: 0.8rem;
}

.edit-form.visible {
  display: flex;
}

.edit-form input[type="text"] {
  padding: 0.8rem 1rem;
  border-radius: 12px;
  border: 1px solid #d7e1f0;
  font-size: 1rem;
}

.edit-form-actions {
  display: flex;
  gap: 0.75rem;
}

.edit-form-actions button {
  border: none;
  border-radius: 10px;
  padding: 0.6rem 1.2rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.edit-form-actions button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(34, 197, 94, 0.35);
}

.edit-form-actions .cancel-edit {
  background: #f1f5f9;
  color: #1f2937;
  box-shadow: none;
}

.edit-form-actions .cancel-edit:hover {
  transform: translateY(-1px);
  background: #e2e8f0;
}

.empty-state {
  margin-top: 2rem;
  text-align: center;
  color: #64748b;
}

@media (max-width: 640px) {
  .container {
    padding: 1.8rem 1.5rem;
  }

  .todo-display {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  .todo-actions {
    width: 100%;
    justify-content: flex-start;
  }
}
